package com.athengzhi.speingCloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Package: com.athengzhi.speingCloud.config
 * @ClassName: GatewayConfig
 * @Author: lhz
 * @CreateTime: 2023/5/22 11:36
 * @Description:
 */
@Configuration
public class GatewayConfig {
    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder routeLocatorBuilder){
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
        routes.route("path_rote_atguigu",r -> r.path("/guonei").uri("http://www.baidu.com")).build();
        return routes.build();
    }
}
